//
//  Song.swift
//  豆瓣电台.Swift
//
//  Created by rongfeng on 16/3/1.
//  Copyright © 2016年 rongfeng. All rights reserved.
//

import UIKit

class Song: NSObject ,NSCoding {

    
    var id:Int!
    var songName:NSString!
    var artistName:NSString!
    var albumName:NSString!
    var songPicSmall:NSString!
    var songPicBig:NSString!
    var songPicRadio:NSString!
    var lrcLink:NSString!
    var songLink:NSString!
    var showLink:NSString!
    
    
    override init() {
        
        
    }
    
    func encodeWithCoder(aCoder: NSCoder) {
        aCoder.encodeInteger(self.id, forKey: "id");
        aCoder.encodeObject(self.songName,forKey: "songName");
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        self.id = aDecoder.decodeIntegerForKey("id");
        self.songName = aDecoder.decodeObjectForKey("songName") as! NSString;
        
    }
    func refreshSong (dic:NSDictionary) {
        
        self.songName = dic["songName"] as! NSString;
        self.artistName = dic["artistName"] as! NSString;
        self.albumName = dic["albumName"] as! NSString;
        self.songPicSmall = dic["songPicSmall"] as! NSString;
        self.songPicBig = dic["songPicBig"] as! NSString;
        self.lrcLink = dic["lrcLink"] as! NSString;
        self.songLink = dic["songLink"] as! NSString;
        self.showLink = dic["showLink"] as! NSString;
        
    }
    
    
    
    
}
